package service

import (
	"api-wareway/handler/model"
	"api-wareway/pkg"
	"github.com/gin-gonic/gin"
	"net/http"
)

func SendSms(c *gin.Context) {
	var form model.SendSmsForm

	if err := c.ShouldBind(&form); err != nil {
		c.JSON(http.StatusBadRequest, gin.H{
			"code": 400,
			"msg":  "验证失败",
		})
		return
	}

	rand := pkg.CodeRand()

	pkg.SendSms(form.Mobile, rand)

}
